<?php
// src/Ipartek/BlogBundle/Admin/NoticiaAdmin.php
namespace Ipartek\BlogBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;

class NoticiaAdmin extends Admin
{
	
	protected function configureFormFields(FormMapper $formMapper)
	{
		$formMapper
		->add('title')	
		->add('categoria')
		->add('excerpt')		
		->add('content','textarea', array('attr' => array('class' => 'tinymce', 'tinymce'=>'{"theme":"simple"}')))
		;
	}
	
	protected function configureDatagridFilters(DatagridMapper $datagridMapper)
	{
		$datagridMapper
		->add('id')
		->add('title')
		->add('categoria')
		->add('excerpt')
		->add('content')
		;
	}
	
	protected function configureListFields(ListMapper $listMapper)
	{
		$listMapper
		->addIdentifier('id')		
		->addIdentifier('title')
		->addIdentifier('slug')
		->add('categoria')
		->add('excerpt')		
		->add('created_at')
		->add('modified_at')
		;
	}
	
	

}